package com.ophiux.FeverManagement.infratructure.repository.wechat;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.ophiux.FeverManagement.domain.entity.WechatInfo;
import com.ophiux.FeverManagement.domain.repository.IWechatInfoRepositories;
import com.ophiux.FeverManagement.infratructure.mapper.wechat.OphiuxWechatInfoMapper;
import com.ophiux.utils.exception.OphiuxDaoException;
import com.ophiux.utils.exception.OphiuxRepositoryException;

import lombok.extern.slf4j.Slf4j;

@Repository
@Slf4j
public class WechatInfoRepositoriesImpl implements IWechatInfoRepositories{
	@Autowired
	OphiuxWechatInfoMapper ophiuxWechatInfoMapper;
	
	@Override
	public String save(WechatInfo model) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void delete(Object uniqueId) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public WechatInfo selectOneByKey(Object uniqueId) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WechatInfo selectOne(Map map) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<WechatInfo> selectAll(Map map) throws OphiuxRepositoryException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public WechatInfo getWechatInfoByNow() throws OphiuxRepositoryException {
		WechatInfo wechat = null;
		try {
			wechat = ophiuxWechatInfoMapper.getWechatInfoByNow();
			
//			wechat = ophiuxWechatInfoMapper.getWechatInfoByNow();
		} catch (OphiuxDaoException e) {
			e.printStackTrace();
			log.info("WechatInfoRepositoriesImpl=>getWechatInfoByNow(),数据库执行异常,异常信息",e);
			throw new OphiuxRepositoryException("WechatInfoRepositoriesImpl=>getWechatInfoByNow(),数据库执行异常");
		}
		return wechat;
	}

}
